package org.bluweb.g4wicket.language.transliteration;

import java.util.HashMap;
import java.util.Map;

import org.apache.wicket.Component;
import org.apache.wicket.markup.html.IHeaderResponse;
import org.bluweb.g4wicket.G4WicketBehaviour;


@SuppressWarnings("serial")
public class Transliteration extends G4WicketBehaviour {

//	private Map<String,String> options = new HashMap<String, String>();
	private String textFieldId;
	
	public Transliteration( String id ) {
		super(id);
	}
	
	@Override
	public void bind(Component component) {
		component.setOutputMarkupId( true );
		this.textFieldId = component.getMarkupId();
	}

	@Override
	public void renderHead(IHeaderResponse response) {
		super.renderHead( response );
		
		Map<String,Object> parameters = new HashMap<String,Object>();
		parameters.put( "textfieldId", this.textFieldId );
		
		response.renderJavascript( this.getJavaScript( "Transliteration.js", parameters ), this.getId() );
	}	
}
